import fly from './fly'

// 种草微服务

// 置顶
export function setTop (id) {
  return fly.post('/discovery/posts/' + id + '/set-top')
}

// 取消置顶
export function cancelTop (id) {
  return fly.post('/discovery/posts/' + id + '/cancel-top')
}

// 创建种草
export function setPost (params) {
  return fly.post('/discovery/posts', params)
}

// 删除种草
export function deletePost (id) {
  return fly.delete('/discovery/posts/' + id)
}

// 获取种草闲情
export function show (id) {
  return fly.get('/discovery/posts/' + id)
}

// 获取店铺种草
export function fetchList (params) {
  return fly.get('/discovery/posts/get-by-shop', params)
}

// 喜欢种草
export function likePost (id) {
  return fly.post('/discovery/posts/' + id + '/like')
}

// 取消喜欢
export function cancelPost (id) {
  return fly.post('/discovery/posts/' + id + '/cancel-like')
}

// 获取公共种草列表
export function publicPosts (params) {
  return fly.get('/discovery/public-product-posts', params)
}

// 展示公共种草
export function showPublicPost (id) {
  return fly.get('/discovery/public-product-posts/' + id)
}
